﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;

namespace EGN_Extractor
{
    class EgnExtractor
    {
        public static List<string> ExtractEgns(string filename)
        {
            StreamReader inputFile = new StreamReader(filename);
            List<string> egns = new List<string>();
            string pattern = @"\b[0-9]{10}\b";
            Regex regex = new Regex(pattern);
            using (inputFile)
            {
                string line = inputFile.ReadLine();
                while (line != null)
                {
                    string currentEgn = regex.Match(line).Value;
                    if (string.IsNullOrEmpty(currentEgn) == false)
                    {
                        egns.Add(currentEgn);
                    }
                    line = inputFile.ReadLine();
                }
            }
            return egns;
        }

        static void Main(string[] args)
        {

        }
    }
}
